'use strict';

angular.module('com.dcos.app').directive('nodedrag', function () {
	return {
		restrict: 'EA',
		scope: {
			arr: '='
		},
		replace: true,
		templateUrl: '../../directive/flow/nodeDrag.html',
		link: function (scope, element) {
			scope.controls=scope.arr;
			element[0].onselectstart = function () {
	            return false;
	        };

	        element[0].ondragstart = function (ev) {
	            ev.dataTransfer.effectAllowed = "move";
	            ev.dataTransfer.setData("Text", ev.target.id);
	            ev.dataTransfer.setDragImage(ev.target, 0, 0);
	            return true;
	        };
	        
	        element[0].ondragend = function (ev) {
	            return false
	        };
		}
	}
});
